#!/usr/bin/python3
# -*- coding: utf-8 -*-

from flask import Blueprint
from ..controllers.auth_controller import AuthController
from ..utils.api_response import ApiResponse

# 创建蓝图
auth_bp = Blueprint('auth', __name__)

# 所有接口都使用POST方法，保持统一风格
auth_bp.route('/register', methods=['POST'])(AuthController.register)  # 创建资源
auth_bp.route('/batch-register', methods=['POST'])(AuthController.batch_register)  # 批量创建
auth_bp.route('/login', methods=['POST'])(AuthController.login)  # 登录
auth_bp.route('/userinfo', methods=['POST'])(AuthController.userinfo)  # 获取用户信息
auth_bp.route('/mock-userinfo', methods=['POST'])(AuthController.mock_userinfo)  # 获取模拟资源
auth_bp.route('/admin/userinfo', methods=['POST'])(AuthController.admin_userinfo)  # 无需鉴权获取用户信息

# 简单的测试路由也改为POST
@auth_bp.route('/test', methods=['POST'])
def test_route():
    """简单的测试路由，验证服务器运行状况"""
    return ApiResponse.success({"message": "服务器正常运行"}) 